/*
* pps_bom
*/
package com.pitop.product.entity;

/**
 * 成品 的实体类的状态
 * 创建 Create,开发中 Developing,生产中 Producting,发货中 Delivery，完成 Done,取消 Cancel
 *
 * @author berton
 */
public enum ProductState implements java.io.Serializable {
    //枚举定义在此
    Create("创建"),
    Developing("开发中"),
    Producting("生产中"),
    Delivery("发货中"),
    Done("完成"),
    Cancel("取消"),;
    private String val;

    ProductState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static ProductState getEnum(String stateName) {
        for (ProductState productState : ProductState.values()) {
            if (productState.name().equalsIgnoreCase(stateName)) {
                return productState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }

}
